/*******************************************************************************
**                                                                            **
** Copyright (C)    (2016)                                               **
**                                                                            **
** All rights reserved.                                                       **
**                                                                            **
** This document contains proprietary information belonging to .         **
** Passing on and copying of this document, and communication                 **
** of its contents is not permitted without prior written authorization.      **
**                                                                            **
********************************************************************************
**                                                                            **
**  FILENAME    : Dem_Types.h                                                 **
**                                                                            **
**  Created on  :                                                             **
**  Author      : tao.yu                                                      **
**  Vendor      :                                                             **
**  DESCRIPTION : Type definitions of DEM                                     **
**                                                                            **
**  SPECIFICATION(S) :   AUTOSAR classic Platform 4.2.2                       **
**                                                                            **
*******************************************************************************/

#ifndef DEM_TYPES_H_
#define DEM_TYPES_H_

/*******************************************************************************
**                      Revision Control History                              **
*******************************************************************************/
/*  <VERSION>    <DATE>    <AUTHOR>    <REVISION LOG>                         */
/*  V1.0.0       2018-4-20  tao.yu    Initial version                         */
/*  V1.0.1       2019-9-17  tao.yu    fix some bug,change event callback      */
/*  V1.0.2       2019-12-25  tao.yu    QAC fix     							  */
/*  V1.0.3       2020-1-7   tao.yu    Commercial project problem modification */
/*******************************************************************************
**                       Version  information                                 **
*******************************************************************************/
#define DEM_TYPES_H_AR_MAJOR_VERSION   4U
#define DEM_TYPES_H_AR_MINOR_VERSION   2U
#define DEM_TYPES_H_AR_PATCH_VERSION   2U
#define DEM_TYPES_H_SW_MAJOR_VERSION   1U
#define DEM_TYPES_H_SW_MINOR_VERSION   0U
#define DEM_TYPES_H_SW_PATCH_VERSION   3U

/*******************************************************************************
**                      Includes                                              **
*******************************************************************************/
#include "Rte_Dem_Type.h"

/*******************************************************************************
**                      macros                                                **
*******************************************************************************/
#define DEM_DTC_GROUP_ALL_DTCS 0xFFFFFFUL

typedef uint16 Dem_ComponentIdType;/*Internal identifier of a monitored component. Remark: 0 is not a valid value*/

typedef uint16 Dem_EventIdType;/*Internal identifier of a diagnostic event Remark: 0 is not a valid value*/

typedef uint16 Dem_RatioIdType;/*OBD specific ratio Id (related to a specific event, a FID, and an IUMPR group). This type depends on the Dem configuration.*/

typedef uint8 Dem_EventStatusType;
#define DEM_EVENT_STATUS_PASSED                      0x00u
#define DEM_EVENT_STATUS_FAILED                      0x01u
#define DEM_EVENT_STATUS_PREPASSED                   0x02u
#define DEM_EVENT_STATUS_PREFAILED                   0x03u
#define DEM_EVENT_STATUS_FDC_THRESHOLD_REACHED       0x04u

typedef uint8 Dem_DebouncingStateType;
#define DEM_TEMPORARILY_DEFECTIVE                    0x01u  /*Bit 0: Temporarily Defective (corresponds to 0 <FDC < 127)*/
#define DEM_FINALLY_DEFECTIVE                        0x02u  /*Bit 1: finally Defective (corresponds to FDC = 127)*/
#define DEM_TEMPORARILY_HEALED                       0x04u  /*Bit 2: temporarily healed (corresponds to -128 < FDC < 0)*/
#define DEM_TEST_COMPLETE                            0x08u  /*Bit 3: Test complete (corresponds to FDC = -128 or FDC = 127)*/
#define DEM_DTR_UPDATE                               0x10u  /*Bit 4: DTR Update (= Test complete && Debouncing complete && enable conditions / storage conditions fulfilled)*/

typedef uint8 Dem_DebounceResetStatusType;
#define DEM_DEBOUNCE_STATUS_FREEZE                   0x00u
#define DEM_DEBOUNCE_STATUS_RESET                    0x01u

typedef uint8 Dem_UdsStatusByteType;
#define DEM_UDS_STATUS_TF                            0x01u /*bit 0: TestFailed*/
#define DEM_UDS_STATUS_TFTOC                         0x02u /*bit 1: TestFailedThisOperationCycle*/
#define DEM_UDS_STATUS_PDTC                          0x04u /*bit 2: PendingDTC*/
#define DEM_UDS_STATUS_CDTC                          0x08u /*bit 3: ConfirmedDTC*/
#define DEM_UDS_STATUS_TNCSLC                        0x10u /*bit 4: TestNotCompletedSinceLastClear*/
#define DEM_UDS_STATUS_TFSLC                         0x20u /*bit 5: TestFailedSinceLastClear*/
#define DEM_UDS_STATUS_TNCTOC                        0x40u /*bit 6: TestNotCompletedThisOperationCycle*/
#define DEM_UDS_STATUS_WIR                           0x80u /*bit 7: WarningIndicatorRequested*/

typedef uint8 Dem_OperationCycleStateType;
#define DEM_CYCLE_STATE_START                        0x00u
#define DEM_CYCLE_STATE_END                          0x01u

typedef uint8 Dem_IndicatorStatusType;
#define DEM_INDICATOR_OFF                            0x00u
#define DEM_INDICATOR_CONTINUOUS                     0x01u
#define DEM_INDICATOR_BLINKING                       0x02u
#define DEM_INDICATOR_BLINK_CONT                     0x03u
#define DEM_INDICATOR_SLOW_FLASH                     0x04u
#define DEM_INDICATOR_FAST_FLASH                     0x05u
#define DEM_INDICATOR_ON_DEMAND                      0x06u
#define DEM_INDICATOR_SHORT                          0x07u

typedef uint8 Dem_DTCKindType;
#define DEM_DTC_KIND_ALL_DTCS                        0x01u
#define DEM_DTC_KIND_EMISSION_REL_DTCS               0x02u /*Select OBD-relevant DTCs*/

typedef uint8 Dem_DTCFormatType;
#define DEM_DTC_FORMAT_OBD                           0x00u /*selects the 2-byte OBD DTC format (refer to configuration parameter DemObdDTC)*/
#define DEM_DTC_FORMAT_UDS                           0x01u /*selects the 3-byte UDS DTC format (refer to configuration parameter DemUdsDTC)*/
#define DEM_DTC_FORMAT_J1939                         0x02u /*selects the merged SPN + FMI to 3-byte J1939 DTC format (refer to DemJ1939DTC)*/

typedef uint8 Dem_DTCOriginType;
#define DEM_DTC_ORIGIN_PRIMARY_MEMORY                0x01u
#define DEM_DTC_ORIGIN_MIRROR_MEMORY                 0x02u
#define DEM_DTC_ORIGIN_PERMANENT_MEMORY              0x03u
/*#define DEM_DTC_ORIGIN_USERDEFINED_MEMORY_XX         0xXX*/ /*Event information locatedin the user defined memory, where XX is the configured DemUserDefinedMemoryIdentifier in hexadecimal*/

typedef uint8 Dem_DTCRequestType;
#define DEM_FIRST_FAILED_DTC                         0x01u
#define DEM_MOST_RECENT_FAILED_DTC                   0x02u
#define DEM_FIRST_DET_CONFIRMED_DTC                  0x03u
#define DEM_MOST_REC_DET_CONFIRMED_DTC               0x04u

typedef uint8 Dem_DTCTranslationFormatType;
#define DEM_DTC_TRANSLATION_ISO15031_6               0x00u
#define DEM_DTC_TRANSLATION_ISO14229_1               0x01u
#define DEM_DTC_TRANSLATION_SAEJ1939_73              0x02u
#define DEM_DTC_TRANSLATION_ISO11992_4               0x03u
#define DEM_DTC_TRANSLATION_J2012DA_FORMAT_04        0x04u

typedef uint8 Dem_DTCSeverityType;
#define DEM_SEVERITY_NO_SEVERITY                     0x00u
#define DEM_SEVERITY_WWHOBD_CLASS_NO_CLASS           0x01u
#define DEM_SEVERITY_WWHOBD_CLASS_A                  0x02u
#define DEM_SEVERITY_WWHOBD_CLASS_B1                 0x04u
#define DEM_SEVERITY_WWHOBD_CLASS_B2                 0x08u
#define DEM_SEVERITY_WWHOBD_CLASS_C                  0x10u
#define DTC_CLASS                                    0x1fu  /*Selects one of the defined DTC classes (or "NO_CLASS")*/
#define DEM_SEVERITY_MAINTENANCE_ONLY                0x20u
#define DEM_SEVERITY_CHECK_AT_NEXT_HALT              0x40u
#define DEM_SEVERITY_CHECK_IMMEDIATELY               0x80u

typedef uint8 Dem_DTRControlType;
#define DEM_DTR_CTL_NORMAL                           0x00u
#define DEM_DTR_CTL_NO_MAX                           0x01u
#define DEM_DTR_CTL_NO_MIN                           0x02u
#define DEM_DTR_CTL_RESET                            0x03u
#define DEM_DTR_CTL_INVISIBLE                        0x04u

typedef uint8 Dem_InitMonitorReasonType;
#define DEM_INIT_MONITOR_CLEAR                       0x01u
#define DEM_INIT_MONITOR_RESTART                     0x02u
#define DEM_INIT_MONITOR_REENABLED                   0x03u
#define DEM_INIT_MONITOR_STORAGE_REENABLED           0x04u

typedef uint8 Dem_IumprDenomCondIdType;
#define DEM_IUMPR_GENERAL_DENOMINATOR                0x01u
#define DEM_IUMPR_DEN_COND_COLDSTART                 0x02u
#define DEM_IUMPR_DEN_COND_EVAP                      0x03u
#define DEM_IUMPR_DEN_COND_500MI                     0x04u

typedef uint8 Dem_IumprDenomCondStatusType;
#define DEM_IUMPR_DEN_STATUS_NOT_REACHED             0x00u
#define DEM_IUMPR_DEN_STATUS_REACHED                 0x01u
#define DEM_IUMPR_DEN_STATUS_INHIBITED               0x02u

/* DemIUMPRDenGroup */
typedef uint8 Dem_IUMPRDenGroupType;
#define DEM_IUMPR_DEN_500MILL                        0u
#define DEM_IUMPR_DEN_COLDSTART                      1u
#define DEM_IUMPR_DEN_EVAP                           2u
#define DEM_IUMPR_DEN_NONE                           3u
#define DEM_IUMPR_DEN_PHYS_API                       4u

/* DemIUMPRGroup */
typedef uint8 Dem_IUMPRGroupType;
#define DEM_IUMPR_BOOSTPRS                           1u
#define DEM_IUMPR_CAT1                               2u
#define DEM_IUMPR_CAT2                               3u
#define DEM_IUMPR_EGR                                4u
#define DEM_IUMPR_EGSENSOR                           5u
#define DEM_IUMPR_EVAP                               6u
#define DEM_IUMPR_FLSYS                              7u
#define DEM_IUMPR_NMHCCAT                            8u
#define DEM_IUMPR_NOXADSORB                          9u
#define DEM_IUMPR_NOXCAT                             10u
#define DEM_IUMPR_OXS1                               11u
#define DEM_IUMPR_OXS2                               12u
#define DEM_IUMPR_PMFILTER                           13u
#define DEM_IUMPR_PRIVATE                            14u
#define DEM_IUMPR_SAIR                               15u
#define DEM_IUMPR_SECOXS1                            16u
#define DEM_IUMPR_SECOXS2                            17u

/* DemRatioKind */
typedef uint8 Dem_RatioKindType;
#define DEM_RATIO_API                                0u
#define DEM_RATIO_OBSERVER                           1u

typedef uint8 Dem_J1939DcmDTCStatusFilterType;
#define DEM_J1939DTC_ACTIVE                          0x00u  /*active DTCs*/
#define DEM_J1939DTC_PREVIOUSLY_ACTIVE               0x01u  /*previously active DTCs*/
#define DEM_J1939DTC_PENDING                         0x02u  /*pending DTCs*/
#define DEM_J1939DTC_PERMANENT                       0x03u  /*permanent DTCs*/
#define DEM_J1939DTC_CURRENTLY_ACTIVE                0x04u  /*currently active DTC*/

typedef uint8 Dem_J1939DcmSetClearFilterType;
#define DEM_J1939DTC_CLEAR_ALL                       0x00u  /*active DTCs*/
#define DEM_J1939DTC_CLEAR_PREVIOUSLY_ACTIVE         0x01u  /*previously active DTCs*/

typedef uint8 Dem_J1939DcmSetFreezeFrameFilterType;
#define DEM_J1939DCM_FREEZEFRAME                     0x00u
#define DEM_J1939DCM_EXPANDED_FREEZEFRAME            0x01u
#define DEM_J1939DCM_SPNS_IN_EXPANDED_FREEZEFRAME    0x02u

typedef uint16 Dem_J1939DcmLampStatusType;
/* bits 8-7    Malfunction Indicator Lamp Status
 * bits 6-5    Red Stop Lamp Status
 * bits 4-3    Amber Warning Lamp Status
 * bits 2-1    Protect Lamp Status
 * bits 8-7    Flash Malfunction Indicator Lamp
 * bits 6-5    Flash Red Stop Lamp
 * bits 4-3    Flash Amber Warning Lamp
 * bits 2-1    Flash Protect Lamp
 */

typedef struct
{
    uint8 ActiveTroubleCodes; /*Number of active DTCs*/
    uint8 PreviouslyActiveDiagnosticTroubleCodes; /*Number of previously active DTCs*/
    uint8 OBDCompliance; /*OBD Compliance*/
    uint8 ContinuouslyMonitoredSystemsSupport_Status; /*Identifies the continuously monitored system support and status*/
    uint16 NonContinuouslyMonitoredSystemsSupport; /*Identifies the non-continuously monitored systems support*/
    uint16 NonContinuouslyMonitoredSystemsStatus; /*Identifies the non-continuously monitored systems status*/
}Dem_J1939DcmDiagnosticReadiness1Type; /*This structure represents all data elemets of the DM05 message*/

typedef struct
{
    uint16 DistanceTraveledWhileMILisActivated; /*The kilometers accumulated while the MIL is activated*/
    uint16 DistanceSinceDTCsCleared; /*Distance accumulated since emission related DTCs were cleared*/
    uint16 MinutesRunbyEngineWhileMILisActivated; /*Accumulated count (in minutes) while the MIL is activated (on)*/
    uint16 TimeSinceDiagnosticTroubleCodesCleared; /*Engine running time accumulated since emission related DTCs were cleared*/
}Dem_J1939DcmDiagnosticReadiness2Type; /*This structure represents all data elemets of the DM21 message*/

typedef struct
{
    uint16 TimeSinceEngineStart; /*Time since key-on that the engine has been running*/
    uint8 NumberofWarmupsSinceDTCsCleared; /*Number of OBD warmup cycles since all DTCs were cleared*/
    uint8 ContinuouslyMonitoredSystemsEnableCompletedStatus; /*Identifies the continuously monitored system enable/completed support and status*/
    uint16 NonContinuouslyMonitoredSystemsEnableStatus; /*Enable status of noncontinuous monitors this monitoring cycle*/
    uint16 NonContinuouslyMonitoredSystems; /*Completion status of noncontinuous monitors this monitoring cycle*/
}Dem_J1939DcmDiagnosticReadiness3Type; /*This structure represents all data elemets of the DM26 message*/

/*******************************************************************************
**                      Dem return types                                      **
*******************************************************************************/
typedef uint8 Dem_ReturnGetStatusOfDTCType; /*Used to return the status of Dem_DcmGetStatusOfDTC.*/
#define DEM_STATUS_OK                               0x00u /*Status of DTC is OK*/
#define DEM_STATUS_WRONG_DTC                        0x01u /*DTC value not existing (in this format)*/
#define DEM_STATUS_WRONG_DTCORIGIN                  0x02u /*Wrong DTC origin*/
#define DEM_STATUS_FAILED                           0x03u /*DTC failed*/
#define DEM_STATUS_PENDING                          0x04u /*The requested value is calculated asynchronously and currently not available. The caller can retry later*/

typedef uint8 Dem_ReturnGetSeverityOfDTCType; /*Used to return the status of Dem_DcmGetSeverityOfDTC*/
#define DEM_GET_SEVERITYOFDTC_OK                    0x00u /*Severity successfully returned*/
#define DEM_GET_SEVERITYOFDTC_WRONG_DTC             0x01u /*DTC value not existing (in UDS format)*/
#define DEM_GET_SEVERITYOFDTC_NOSEVERITY            0x02u /*Severity information is not available*/
#define DEM_GET_SEVERITYOFDTC_PENDING               0x03u /*The requested value is calculated asynchronously and currently not available. The caller can retry later.*/

typedef uint8 Dem_ReturnGetFunctionalUnitOfDTCType; /*Used to return the status of Dem_DcmGetFunctionalUnitOfDTC*/
#define DEM_GET_FUNCTIONALUNITOFDTC_OK              0x00u /*Functional unit successfully returned*/
#define DEM_GET_FUNCTIONALUNITOFDTC_WRONG_DTC       0x01u /*DTC value not existing (in UDS format)*/

typedef uint8 Dem_ReturnSetFilterType; /*Used to return the status of (re-)setting a specific filter*/
#define DEM_FILTER_ACCEPTED                         0x00u /*Filter was accepted*/
#define DEM_WRONG_FILTER                            0x01u /*Wrong filter selected*/

typedef uint8 Dem_ReturnGetNumberOfFilteredDTCType; /*Used to return the status of Dem_DcmGetNumberOfFilteredDTC*/
#define DEM_NUMBER_OK                               0x00u /*Getting number of filtered DTCs was successful*/
#define DEM_NUMBER_FAILED                           0x01u /*Getting number of filtered DTCs failed.*/
#define DEM_NUMBER_PENDING                          0x02u /*The requested value is calculated asynchronously and currently not available. The caller can retry later*/

typedef uint8 Dem_ReturnGetNextFilteredElementType; /*Used to return the status of Dem_DcmGetNextFilteredXxx and Dem_J1939DcmGetNextFilteredXxx.*/
#define DEM_FILTERED_OK                             0x00u /*Returned next filtered element*/
#define DEM_FILTERED_NO_MATCHING_ELEMENT            0x01u /*No further element (matching the filter criteria) found*/
#define DEM_FILTERED_PENDING                        0x02u /*The requested value is calculated asynchronously and currently not available. The caller can retry later.
                                                           Only used by asynchronous interfaces.*/
#define DEM_FILTERED_BUFFER_TOO_SMALL               0x03u /*Buffer in the BufSize parameter is not huge enough*/

typedef uint8 Dem_ReturnGetDTCByOccurrenceTimeType; /*Used to return the status of Dem_DtcGetDTCByOccurrenceTime*/
#define DEM_OCCURR_OK                               0x00u /*matching DTC available*/
#define DEM_OCCURR_NOT_AVAILABLE                    0x01u /*no DTC is matching the requested occurrence time*/

typedef uint8 Dem_ReturnDisableDTCRecordUpdateType; /*Used to return the status of Dem_DcmDisableDTCRecordUpdate*/
#define DEM_DISABLE_DTCRECUP_OK                     0x00u /*Event memory update of DTC successfully disabled*/
#define DEM_DISABLE_DTCRECUP_WRONG_DTC              0x01u /*DTC value not existing (in UDS format)*/
#define DEM_DISABLE_DTCRECUP_WRONG_DTCORIGIN        0x02u /*Wrong DTC origin*/
#define DEM_DISABLE_DTCRECUP_PENDING                0x03u /*Disabling is currently not possible. The caller can retry later*/

typedef uint8 Dem_ReturnGetFreezeFrameDataByDTCType; /*Used to return the status of Dem_DcmGetFreezeFrameDataByDTC*/
#define DEM_GET_FFDATABYDTC_OK                      0x00u /*Size successfully returned*/
#define DEM_GET_FFDATABYDTC_WRONG_DTC               0x01u /*DTC value not existing (in UDS format)*/
#define DEM_GET_FFDATABYDTC_WRONG_DTCORIGIN         0x02u /*Wrong DTC origin*/
#define DEM_GET_FFDATABYDTC_WRONG_RECORDNUMBER      0x03u /*Record number is not supported by configuration and therefore invalid*/
#define DEM_GET_FFDATABYDTC_WRONG_BUFFERSIZE        0x04u /*provided buffer size to small*/
#define DEM_GET_FFDATABYDTC_PENDING                 0x05u /*The requested value is calculated asynchronously and currently not available. The caller can retry later.*/
#define DEM_GET_FFDATABYDTC_FAILED                  0x06u /*failed to get ,because there is no event failed */

typedef uint8 Dem_ReturnGetExtendedDataRecordByDTCType; /*Used to return the status of Dem_DcmGetExtendedDataRecordByDTC*/
#define DEM_RECORD_OK                               0x00u /*Extended data record successfully returned*/
#define DEM_RECORD_WRONG_DTC                        0x01u /*DTC value not existing (in UDS format)*/
#define DEM_RECORD_WRONG_DTCORIGIN                  0x02u /*Origin wrong*/
#define DEM_RECORD_WRONG_NUMBER                     0x03u /*Record number is not supported by configuration and therefore invalid*/
#define DEM_RECORD_WRONG_BUFFERSIZE                 0x04u /*Provided buffer to small*/
#define DEM_RECORD_PENDING                          0x05u /*The requested value is calculated asynchronously and currently not available. The caller can retry later.*/
#define DEM_RECORD_FAILED                           0x06u /*failed to get ,because there is no event failed */

typedef uint8 Dem_ReturnGetSizeOfDataByDTCType; /*Used to return the status of Dem_DcmGetSizeOfFreezeFrameByDTC and Dem_DcmGetSizeOfExtendedDataRecordByDTC.*/
#define DEM_GETSIZEBYDTC_OK                         0x00u /*Size successfully returned*/
#define DEM_GETSIZEBYDTC_WRONG_DTC                  0x01u /*DTC value not existing (in UDS format)*/
#define DEM_GETSIZEBYDTC_WRONG_DTCORIGIN            0x02u /*Wrong DTC origin*/
#define DEM_GETSIZEBYDTC_WRONG_RECNUM               0x03u /*Record number is not supported by configuration and therefore invalid*/
#define DEM_GETSIZEBYDTC_PENDING                    0x04u /*The requested value is calculated asynchronously and currently not available. The caller can retry later*/

typedef uint8 Dem_ReturnClearDTCType; /*Used to return the status of Dem_<...>ClearDTC.*/
#define DEM_CLEAR_OK                                0x00u /*DTC successfully cleared*/
#define DEM_CLEAR_WRONG_DTC                         0x01u /*DTC value not existing (in this format)*/
#define DEM_CLEAR_WRONG_DTCORIGIN                   0x02u /*Wrong DTC origin*/
#define DEM_CLEAR_FAILED                            0x03u /*DTC clearing failed*/
#define DEM_CLEAR_PENDING                           0x04u /*The DTC clearing is performed asynchronously and still pending. The caller can retry later*/
#define DEM_CLEAR_BUSY                              0x05u /*DTC not cleared, as another clearing process is in progress. The caller can retry later*/
#define DEM_CLEAR_MEMORY_ERROR                      0x06u /*An error occurred during erasing a memory location (e.g. if DemClearDTCBehavior in Dem is
                                                           set to DEM_CLRRESP_NONVOLATILE_FINISH and erasing of non-volatile-block failed)*/

typedef uint8 Dem_ReturnControlDTCSettingType; /*Used to return the status of Dem_DcmDisableDTCSetting and Dem_DcmEnableDTCSetting*/
#define DEM_CONTROL_DTC_SETTING_OK                  0x00u /*DTC setting control successful*/
#define DEM_CONTROL_DTC_SETTING_N_OK                0x01u /*DTC setting control not successful*/
#define DEM_CONTROL_DTC_WRONG_DTCGROUP              0x02u /*DTC setting control not successful because group of DTC was wrong*/

#define DEM_E_NO_DTC_AVAILABLE                      0x02u
#define DEM_E_NO_FDC_AVAILABLE                      0x03u
#define DEM_E_WRONG_CONFIGURATION                   0x10u
#define DEM_E_PARAM_POINTER                         0x11u
#define DEM_E_PARAM_DATA                            0x12u
#define DEM_E_PARAM_LENGTH                          0x13u
#define DEM_E_INIT_FAILED                           0x14u
#define DEM_E_WRONG_BUFFERSIZE                      0x15u
#define DEM_E_UNINIT                                0x20u
#define DEM_E_NODATAAVAILABLE                       0x30u
#define DEM_E_WRONG_RECORDNUMBER                    0x31u
#define DEM_E_WRONG_DIDNUMBER                       0x32u
#define DEM_E_WRONG_CONDITION                       0x40u

/* Service ID */
#define DEM_SID_GETVERSIONINFO                      0x00u
#define DEM_SID_PREINIT                             0x01u
#define DEM_SID_INIT                                0x02u
#define DEM_SID_SHUTDOWN                            0x03u
#define DEM_SID_REPORTERRORSTATUS                   0x0fu
#define DEM_SID_SETEVENTAVAILABLE                   0x37u
#define DEM_SID_SETEVENTSTATUS                      0x04u
#define DEM_SID_RESETEVENTDEBOUNCESTATUS            0x09u
#define DEM_SID_RESETEVENTSTATUS                    0x05u
#define DEM_SID_PRESTOREFREEZEFRAME                 0x06u
#define DEM_SID_CLEARPRESTOREDFREEZEFRAME           0x07u
#define DEM_SID_SETOPERATIONCYCLESTATE              0x08u
#define DEM_SID_GETOPERATIONCYCLESTATE              0x9eu
#define DEM_SID_SETAGINGCYCLESTATE                  0x11u
#define DEM_SID_SETWIRSTATUS                        0x7au
#define DEM_SID_GETCOMPONENTFAILED                  0x2au
#define DEM_SID_GETEVENTSTATUS                      0x0au
#define DEM_SID_GETEVENTFAILED                      0x0bu
#define DEM_SID_GETEVENTTESTED                      0x0cu
#define DEM_SID_GETDEBOUNCINGOFEVENT                0x9fu
#define DEM_SID_GETDTCOFEVENT                       0x0du
#define DEM_SID_SETENABLECONDITION                  0x39u
#define DEM_SID_SETSTORAGECONDITION                 0x38u
#define DEM_SID_GETFAULTDETECTIONCOUNTER            0x3eu
#define DEM_SID_GETINDICATORSTATUS                  0x29u
#define DEM_SID_SETINDICATORSTATUS                  0xa1u
#define DEM_SID_GETEVENTFREEZEFRAMEDATAEX           0x6eu
#define DEM_SID_GETEVENTEXTENDEDDATARECORDEX        0x6du
#define DEM_SID_GETEVENTMEMORYOVERFLOW              0x32u
#define DEM_SID_GETNUMBEROFEVENTMEMORYENTRIES       0x35u
#define DEM_SID_SETCOMPONENTAVAILABLE               0x2bu
#define DEM_SID_SETDTCSUPPRESSION                   0x33u
#define DEM_SID_CLEARDTC                            0x23u

#define DEM_SID_MAINFUNCTION                        0x55u

#define DEM_SID_DCMGETTRANSLATIONTYPE                   0x3cu
#define DEM_SID_DCMGETDTCSTATUSAVAILABILITYMASK         0x16u
#define DEM_SID_DCMGETSTATUSOFDTC                       0x15u
#define DEM_SID_DCMGETSEVERITYOFDTC                     0x0eu
#define DEM_SID_DCMGETFUNCTIONALUNITOFDTC               0x34u
#define DEM_SID_DCMSETDTCFILTER                         0x13u
#define DEM_SID_DCMGETNUMBEROFFILTEREDDTC               0x17u
#define DEM_SID_DCMGETNEXTFILTEREDDTC                   0x18u
#define DEM_SID_DCMGETNEXTFILTEREDDTCANDFDC             0x3bu
#define DEM_SID_DCMGETNEXTFILTEREDDTCANDSEVERITY        0x3du
#define DEM_SID_DCMSETFREEZEFRAMERECORDFILTER           0x3fu
#define DEM_SID_DCMGETNEXTFILTEREDRECORD                0x3au
#define DEM_SID_DCMGETDTCBYOCCURRENCETIME               0x19u
#define DEM_SID_DCMCONTROLDTCSTATUSCHANGEDNOTIFICATION  0xb0u
#define DEM_SID_DCMDISABLEDTCRECORDUPDATE               0x1au
#define DEM_SID_DCMENABLEDTCRECORDUPDATE                0x1bu
#define DEM_SID_DCMGETFREEZEFRAMEDATABYDTC              0x1du
#define DEM_SID_DCMGETSIZEOFFREEZEFRAMEBYDTC            0x1fu
#define DEM_SID_DCMGETEXTENDEDDATARECORDBYDTC           0x20u
#define DEM_SID_DCMGETSIZEOFEXTENDEDDATARECORDBYDTC     0x21u
#define DEM_SID_DCMCHECKCLEARPARAMETER                  0x7bu
#define DEM_SID_DCMCLEARDTC                             0x22u
#define DEM_SID_DCMDISABLEDTCSETTING                    0x24u
#define DEM_SID_DCMENABLEDTCSETTING                     0x25u
#define DEM_SID_DCMGETINFOTYPEVALUE08                   0x6bu
#define DEM_SID_DCMGETINFOTYPEVALUE0B                   0x6cu
#define DEM_SID_DCMREADDATDOFPID01                      0x61u
#define DEM_SID_DCMREADDATDOFPID1C                      0x63u
#define DEM_SID_DCMREADDATDOFPID21                      0x64u
#define DEM_SID_DCMREADDATDOFPID30                      0x65u
#define DEM_SID_DCMREADDATDOFPID31                      0x66u
#define DEM_SID_DCMREADDATDOFPID41                      0x67u
#define DEM_SID_DCMREADDATDOFPID4D                      0x68u
#define DEM_SID_DCMREADDATDOFPID4E                      0x69u
#define DEM_SID_DCMREADDATDOFPID91                      0x6Au
#define DEM_SID_DCMREADDATAOFOBDFREEZEFRAME             0x52u
#define DEM_SID_DCMGETDTCOFOBDFREEZEFRAME               0x53u
#define DEM_SID_DCMGETAVAILABLEOBDMIDS                  0xa3u
#define DEM_SID_DCMGETNUMTIDSOFOBDMID                   0xa4u
#define DEM_SID_DCMGETDTRDATA                           0xa5u

#define DEM_SID_J1939DCMSETDTCFILTER                    0x90u
#define DEM_SID_J1939DCMGETNUMBEROFFILTEREDDTC          0x91u
#define DEM_SID_J1939DCMGETNEXTFILTEREDDTC              0x92u
#define DEM_SID_J1939DCMFIRSTDTCWITHLAMPSTATUS          0x93u
#define DEM_SID_J1939DCMGETNEXTDTCWITHLAMPSTATUS        0x94u
#define DEM_SID_J1939DCMCLEARDTC                        0x95u
#define DEM_SID_J1939DCMSETFREEZEFRAMEFILTER            0x96u
#define DEM_SID_J1939DCMGETNEXTFREEZEFRAME              0x97u
#define DEM_SID_J1939DCMGETNEXTSPNINFREEZEFRAME         0x98u
#define DEM_SID_J1939DCMSETRATIOFILTER                  0x99u
#define DEM_SID_J1939DCMGETNEXTFILTEREDRATIO            0x9au
#define DEM_SID_J1939DCMREADDIAGNOSTICREADINESS1        0x9bu
#define DEM_SID_J1939DCMREADDIAGNOSTICREADINESS2        0x9cu
#define DEM_SID_J1939DCMREADDIAGNOSTICREADINESS3        0x9du

#define DEM_SID_DLTGETMOSTRECENTFREEZEFRAMERECORDDATA   0x41u
#define DEM_SID_DLTGETALLEXTENDEDDATARECORDS            0x40u

#define DEM_SID_SETEVENTDISABLED                        0x51u
#define DEM_SID_REPIUMPRFAULTDETECT                     0x73u
#define DEM_SID_SETIUMPRDENCONDITION                    0xaeu
#define DEM_SID_GETIUMPRDENCONDITION                    0xafu
#define DEM_SID_REPIUMPRDENLOCK                         0x71u
#define DEM_SID_REPIUMPRDENRELEASE                      0x72u
#define DEM_SID_SETPTOSTATUS                            0x79u
#define DEM_SID_READDATAOFPID01                         0xb3u
#define DEM_SID_GETDATAOFPID21                          0xb1u
#define DEM_SID_SETDATAOFPID21                          0xa6u
#define DEM_SID_SETDATAOFPID31                          0xa7u
#define DEM_SID_SETDATAOFPID4D                          0xa8u
#define DEM_SID_SETDATAOFPID4E                          0xa9u
#define DEM_SID_SETPFCCYCLEQUALIFIED                    0xaau
#define DEM_SID_GETPFCCYCLEQUALIFIED                    0xabu
#define DEM_SID_SETCLEARDTC                             0xacu
#define DEM_SID_DCMGETDTCSEVERITYAVAILABILITYMASK       0xb2u
#define DEM_SID_GETB1COUNTER                            0xb4u
#define DEM_SID_SETDTR                                  0xa2u

/*******************************************************************************
**                      Global Variable declaration                           **
*******************************************************************************/

/*******************************************************************************
**                      Global Function declaration                           **
*******************************************************************************/

#endif /* DEM_TYPES_H_ */

/*******************************************************************************
**                      end of file                                           **
*******************************************************************************/
